﻿// *********************************************************************
// [DCOM Productions]
// [Copyright (C) DCOM Productions All rights reserved.]
// *********************************************************************

namespace BitFlex.Windows.Forms.Design {
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms.Design;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.ComponentModel.Design;

    /// <summary>
    /// Windows Forms Designer for <see cref="BitFlex.Windows.Forms.Wizard"/>
    /// </summary>
    public class WizardDesigner : ParentControlDesigner {

        private WizardActionList m_ActionList;
        /// <summary>
        /// Overrides base implementation of ActionLists
        /// </summary>
        public override System.ComponentModel.Design.DesignerActionListCollection ActionLists {
            get {
                if (m_ActionList == null) {
                    m_ActionList = new WizardActionList(this.Component);
                }
                return new DesignerActionListCollection(new DesignerActionList[] { m_ActionList });
            }
        }

        /// <summary>
        /// Overrides base implementation of CanParent
        /// </summary>
        public override bool CanParent(System.Windows.Forms.Control control) {
            return (control is WizardPage);
        }

        protected override void OnPaintAdornments(System.Windows.Forms.PaintEventArgs pe) {
            base.OnPaintAdornments(pe);
            using (Pen pen = new Pen(Brushes.LightGray, 1.0F) { DashStyle = DashStyle.Dash }) {
                Rectangle rect = Control.ClientRectangle;
                rect.Height--;
                rect.Width--;
                pe.Graphics.DrawRectangle(pen, rect);
            }
        }

        public override bool CanBeParentedTo(IDesigner parentDesigner) {
            return base.CanBeParentedTo(parentDesigner);
        }
    }
}